class calculator{

	public static int ret(int i)
{
if(i>0)
return ;
}
public static int max(int x, int y)
{
if(x>y)
return x;
else
return y;
}


public static void years(int year){
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
System.out.println(year +"given year is leap year\n");
else
System.out.println(year +"given year is not leap year\n");
}

*/
public static void IsPrim(long num)
{ 
int flag=0;
for(int i=2;i<num;i++)
{
if(num %i==0)
{
System.out.println(num +" is not prime number");
flag=1;
break;
}
}
if(flag==0)
System.out.println(num +" is prime number");


}

public static void main(String []args){


// string to integer type cast

String s="1";
int n=Integer.parseInt(s);

System.out.println(n);

// page 40

int i=9;
if((i>2) && (i<6))
System.out.println("i is the integer bet 2 and 6 ");
else
System.out.println("is is not the integer bet 2 and 6 ");


//given year is leap year or not
 
years(2010);


//the given no is even or odd

int number=43;

if(number%2==0)
System.out.println("the number is even\n");
else
System.out.println("the number is odd\n");


//the given no is prime or not

IsPrim(99991);


// page 46

char ch='c';

switch(ch){
case 'a':System.out.println(ch);
case 'b':System.out.println(ch);
case 'c':System.out.println(ch);
}



// print the string 100 times
int i=0;
while(i<100)
{
System.out.println("I WILL PRACTISE EVERYDAY");
i++;
}



//print even no between 0 to 100

for(int i=0;i<=100;i++)
{
if(i%2 ==0)
System.out.println(i);
} 


//print odd no between 1000 to 5000

for(int i=1000;i<=5000;i++)
{
if(i%2 ==1)
System.out.println(i);
} 



//  print prime no until the max posible

// add max of two no

int res=max(5,8);
System.out.println(res);


// (RETURN ;) WHAT HAPPENS
System.out.println(ret(5));
	// Reverswe string
	
	public static char[] rev(char[] r){
	char[] result=new char[r.length];
	r[last]=r.length-1;
		for(int i=0;i<result.length;i++){
		r[i]=r[last];
		last--;
		
		}
			return result;
		}
		
	//print 
	
	public static void print(int[] r){
		for(int i=0;i<r.length;i++){
		  System.out.println(r[i]);
		}
	}

	// fibonacci
	
	 public static int[] fibo(int f){
	 int []fib=new int[f];
	 fib[0]=0;
	 fib[1]=1;
	 for(int i=2;i<f;i++){
	 fib[i]=fib[i-1]+fib[i-2];
	 }
	 return fib;
	 
	 }
	
	
	// even no

	public static int[] even(int f,int t){
	
	int[] e=new int[t];
	int count=0;
	for(int i=f;i<=t;i++){
	if(i%2==0){
		e[count]= i;
		count++;
	}
	}
	return e;
	}

// odd no

	public static int[] odd(int f,int t){
	
	int[] e=new int[t];
	int count=0;
	for(int i=f;i<=t;i++){
	if(i%2==1){
		e[count]= i;
		count++;
	}
	}
	return e;
	}
	
	// compute the sum of all the elements in an arrays
	
	public static int suma(int[] arr){
	int temp=0;
	int res;
	for(int i=0;i<arr.length;i++){
	res=temp+arr[i];
	temp=res;
	}
	return temp;
	}
		
	
	
	
	}
	
